import { Component, OnInit } from '@angular/core';
import { AxiosService } from '../../axios.service';


@Component({
  selector: 'app-design-process',
  templateUrl: './design-process.component.html',
  styleUrls: ['./design-process.component.scss']
})
export class DesignProcessComponent implements OnInit {
  listOfData;
  constructor(public axios: AxiosService,) { }

  ngOnInit(): void {
    this.getData();
  }

  // 请求数据
  getData() {
    this.axios.axiosPost('QuerySegmentSchedule', { segment: 'design' })
      .then((data) => {
        this.listOfData = data['order'];
        this.listOfData.sort((a, b) => {
          return a.delivery_date > b.delivery_date ? 1 : -1;
        })
        console.log(this.listOfData);
      })
      .catch((err) => {
        console.log(err);
      })
  }

}
